<?php
/**
 * NOTICE OF LICENSE
 *
 * This source file is subject to the  Academic Free License (AFL 3.0)
 * that is available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to support@zprofess.com so we can send you a copy immediately.
 *
 * @category   	Prestashop module
 * @package		Help Desk
 * @version 	1.0
 * @author 		Kurosaki <kurosaki@zprofess.com>
 * @copyright   Copyright (c) 2012 ZPROFESS. (http://zprofess.com)
 * @license    	http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
require_once (_PS_CLASS_DIR_ . 'FrontController.php');
include_once(dirname(__FILE__)."/../Zadmindepartment.php");
include_once(dirname(__FILE__)."/../ZadminPriority.php");
include_once(dirname(__FILE__)."/../classes/ZticketObject.php");
include_once(dirname(__FILE__)."/../ZadminRating.php");

class ZhelpdeskBlockTicketController extends FrontControllerCore {
	public function __construct() { 
		parent::__construct();
	}
	
    public function setMedia() {
    	parent::setMedia();
    	Tools::addCSS(_MODULE_DIR_.'/zhelpdesk/css/block-ticket.css');
    	Tools::addJS(_MODULE_DIR_.'/zhelpdesk/js/block-ticket.js');
		self::$smarty->assign(array(
			'meta_title'=> 'My Helpdesk',
			'meta_description' => 'My Helpdesk',
		));
    }

    /**
     * display content
     */
    public function displayContent() {
    	$linkPost = Tools::getShopDomain(true).__PS_BASE_URI__.'modules/zhelpdesk/zhelpdesk-post-ticket.php';
    	$linkTicket = Tools::getShopDomain(true).__PS_BASE_URI__.'modules/zhelpdesk/zhelpdesk-ticket.php';
    	$id_customer = (!$id_customer = (int)self::$cookie->id_customer) ? false : (int)self::$cookie->id_customer;
    	self::$smarty->assign(array(
			'linkPost'=> $linkPost,
    		'linkTicket' => $linkTicket,
    		'id_customer' => $id_customer
		));
        self::$smarty->display(_PS_MODULE_DIR_ . 'zhelpdesk/themes/block-ticket.tpl');
    }    
}
